home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
cboot.d64
/
comal'dump.asm
< prev
next >
Wrap
Assembly Source File
|
2009-01-23
|
5KB
|
251 lines
; HIGH-RES SCREEN DUMP ROUTINE
; V4.0 4/18/84 (C) W. LOUIE
; FOR USE WITH C64 COMAL 0.14
; AND EPSON MX-80 W/GRAFTRAX.
;
; ASSEMBLE IN HIGH RAM [$C000].
; [ SYS 49152 ] TO DUMP SCREEN.
; PRESS POUND KEY TO ABORT DUMP.
;
; HIGH-RES SCREEN MAY BE DUMPED
; AT ANY TIME. BIT-MAP SCREEN
; IMAGE LIES UNTOUCHED BELOW
; SYSTEM ROM AT [$E000].
;
;
; KERNAL / SYSTEM EQUATES
SCNKEY = $FF9F
SETLFS = $FFBA
SETNAM = $FFBD
OPEN = $FFC0
CLOSE = $FFC3
CHKOUT = $FFC9
CHROUT = $FFD2
CLALL = $FFE7
GETIN = $FFE4
TIMER = $DC0E
BUFFER = $CE00
PRTPAT = $CFF0
ADDR1 = $CFFA
ADDR2 = $CFFB
ROW = $CFFC
COL = $CFFD
TEMP1 = $CFFE
TEMP2 = $CFFF
;
; ZERO PAGE LOCATIONS
BITMAP = $8B
MAPHI = $8C
BUFR = $8D
BUFHI = $8E
FLAG = $8F
;
; ASSEMBLE IN HIGH RAM
*= $C000
;
; DISABLE INTERRUPTS
LDA TIMER
STA TEMP2
AND #$FE
STA TIMER
; OPEN THE PRINTER [ OPEN4,4 ]
LDA #$04
TAX
LDY #$FF
JSR SETLFS
LDA #$00
TAX
TAY
JSR SETNAM
JSR OPEN
LDX #$04
JSR CHKOUT
; SET UP FOR 4 DOT LINE SPACING
LDA #$1B
JSR CHROUT
LDA #$41
JSR CHROUT
LDA #$04
JSR CHROUT
; SCREEN BIT MAP LOCATION - $E000
LDA #$00
STA BITMAP
STA ADDR1
STA ROW
LDA #$E0
STA MAPHI
STA ADDR2
; BUFFER LOCATION - $CE00
NEWROW LDA #$00
STA BUFR
LDA #$CE
STA BUFHI
; SET FLAG TO ZERO
LDA #$00
STA FLAG
; SET COLUMN COUNT TO ZERO
STA COL
; LOAD BUFFER WITH 1 ROW
;
; SAVE 6510 I/O REGISTER AND
; DISABLE EVERYTHING TO ALLOW
; RAM TO BE READ INSTEAD OF ROM
LDA $01
STA TEMP1
LDA #$00
STA $01
;
LOAD LDY #$07
VICROW LDA (BITMAP),Y
LDX #$00
EPSCOL ASL A
ROR PRTPAT,X
INX
CPX #$08
BCC EPSCOL
DEY
BPL VICROW
; MOVE PRTPAT TO BUFFER
LDY #$00
MOVE LDA PRTPAT,Y
STA (BUFR),Y
INY
CPY #$08
BNE MOVE
; INCREMENT BUFFER INDEX BY 8
CLC
LDA BUFR
ADC #$08
STA BUFR
LDA BUFHI
ADC #$00
STA BUFHI
; INCREMENT BIT MAP INDEX BY 8
CLC
LDA BITMAP
ADC #$08
STA BITMAP
LDA MAPHI
ADC #$00
STA MAPHI
; INCREMENT COLUMN COUNT
INC COL
; FINISHED WITH ROW <40 CHAR.> ?
LDA COL
CMP #$28
BNE LOAD
; BUFR NOW CONTAINS A ROW IN
; THE EPSON COLUMN FORMAT.
;
; ENABLE SYSTEM ROM AGAIN
LDA TEMP1
STA $01
;
;
; CENTER OUTPUT WITH 13 SPACES
PRINT LDX #$00
LDA #$20
PADOUT JSR CHROUT
INX
CPX #$0D
BNE PADOUT
; SET UP PRINTER FOR GRAPHICS MODE
; 8 COL/CHAR X 40 CHAR = 320 COL
LDA #$1B
JSR CHROUT
LDA #$4B
JSR CHROUT
LDA #$40
JSR CHROUT
LDA #$01
JSR CHROUT
; SEND BUFFER TO PRINTER
LDX #$00
OUT1 LDA BUFFER,X
JSR SENDIT
INX
CPX #$A0
BNE OUT1
LDX #$00
OUT2 LDA BUFFER+$A0,X
JSR SENDIT
INX
CPX #$A0
BNE OUT2
; DUMP PRINTER BUFFER WITH CR.
LDA #$0D
JSR CHROUT
; POUND KEY PRESSED ?
JSR SCNKEY
JSR GETIN
CMP #$5C
; YES, ABORT SCREEN DUMP
BEQ QUIT
; PRINT BOTTOM DOTS ?
LDA FLAG
CMP #$FF
BEQ NEXT
LDA #$FF
STA FLAG
JMP PRINT
; INCREMENT ROW COUNT
NEXT INC ROW
; DUMPED ALL 25 ROWS ?
LDA ROW
CMP #$19
BEQ QUIT
; INCREMENT BIT MAP INDEX BY 320
CLC
LDA ADDR1
ADC #$40
STA ADDR1
STA BITMAP
LDA ADDR2
ADC #$01
STA ADDR2
STA MAPHI
; GET THE NEXT ROW
JMP NEWROW
;
; END OF DUMP ROUTINE
;
; RESET PRINTER MODE
QUIT LDA #$1B
JSR CHROUT
LDA #$40
JSR CHROUT
LDA #$0D
JSR CHROUT
; CLOSE 4,4 - RESET I/O CHANNELS
LDA #$04
JSR CLOSE
JSR CLALL
; ENABLE INTERRUPTS
LDA TEMP2
STA TIMER
; RETURN TO COMAL
RTS
;
;
;
; SEND COLUMN TO PRINTER ROUTINE
SENDIT LDY FLAG
CPY #$FF
BEQ LOWER
; SEND UPPER 4 DOTS
ROR A
ROR A
ROR A
ROR A
; SEND LOWER 4 DOTS
LOWER AND #$0F
JSR CHROUT
; DELAY LOOP, COUNT TO 255
LDY #$00
WAIT INY
CPY #$FF
BNE WAIT
RTS
;
.END